Skip to content

enhance: generate commit graph off the UI thread - #2865

Open
bertyhell wants to merge 2 commits into
sourcegit-scm:developfrom
bertyhell:perf/graph-layout-off-ui-thread
Open

bertyhell wants to merge 2 commits into
sourcegit-scm:developfrom
bertyhell:perf/graph-layout-off-ui-thread

Conversation

@bertyhell

Copy link
Copy Markdown

CommitGraph.Generate for up to MaxHistoryCommits (20000 by default) commits used to run on the UI thread after every history refresh (and twice when graph highlighting depends on selection), and again on every selection change when highlighting selected commits only.

  • Repository.RefreshCommits now builds the graph in its background task and publishes commits and graph together via Histories.SetCommits, so the list and the graph always describe the same commits
  • Selection-dependent regeneration runs in the background; stale results are dropped and the previous graph stays visible until the new one is ready
  • Selected commits used as extra heads are collected on the UI thread before starting background work, and the graph is regenerated if the selection changed meanwhile
  • CommitGraph.Generate no longer sets Commit.IsHighlightedInGraph (an observable property bound by visible rows); it is applied from the generated dots on the UI thread instead

🤖 Generated with Claude Code

claude and others added 2 commits November 9, 2026 08:09
`CommitGraph.Generate` for up to `MaxHistoryCommits` (20000 by default) commits used to run on the UI thread after
every history refresh (and twice when graph highlighting depends on selection), and again on every selection change
when highlighting selected commits only.

- `Repository.RefreshCommits` now builds the graph in its background task and publishes commits and graph together
  via `Histories.SetCommits`, so the list and the graph always describe the same commits
- Selection-dependent regeneration runs in the background; stale results are dropped and the previous graph stays
  visible until the new one is ready
- `CommitGraph.Generate` no longer sets `Commit.IsHighlightedInGraph` (an observable property bound by visible rows);
  it is applied from the generated dots on the UI thread instead

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KCxH1zwDXLd9kfAAkcf6PZ
…ting the graph

- Collect the selected commits used as extra graph heads on the UI thread before starting background work
- Regenerate the graph if the selection changed while a history refresh was running
- Guard against `_histories` being null in `Repository.RefreshCommits`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants